#ifndef AUTOLOCK_H
#define AUTOLOCK_H

#include <windows.h>

class autoLock
{
public:
	autoLock(CRITICAL_SECTION& cs):m_rcs(cs)
	{
		EnterCriticalSection(&m_rcs);
	}
	~autoLock()
	{
		LeaveCriticalSection(&m_rcs);
	}
private:
	CRITICAL_SECTION& m_rcs; 
};
#endif